package de.tabuma.soapforms.soapproject.controller;

import de.tabuma.soapforms.*;
import de.tabuma.lib.tabumacontroller;
import java.io.PrintWriter;
import java.util.*;
import java.util.logging.*;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.google.appengine.api.users.*;

/**
 *
 * @author alefen
 */
public class create extends tabumacontroller {

    private static final Logger log = Logger.getLogger(create.class.getName());

    public create(String servlet, Hashtable parameter) {
        super(servlet, parameter);
    }

    @Override
    public void navigate(ServletContext context, HttpServletRequest request, HttpServletResponse response, PrintWriter out) {

        String wrongUrl = "Url, Parameter or Name is not valid.";

        UserService userService = UserServiceFactory.getUserService();
        User user = userService.getCurrentUser();

        if(request.getParameter(constants.cancel)!=null) {
            list list = new list(this.getServlet(), this.getParameter());
            list.navigate(context, request, response, out);
            return;
        }

        if(request.getParameter(constants.addSoapProject)!=null) {
            request.setAttribute(constants.addSoapProject, "true");
            return;
        }

    }
}
